$file_path = "ereader/qml/ereader/";
$localed_file_prefix = "ereader_";
$localed_file_suffix = ".ts";
$out_put_folder = $file_path."i18n";
$compiled_file_suffix = ".qm";
@local_file_lans = ("zh", "en");

@source_files = <ereader/qml/ereader/*.qml>;


	
foreach $language (@local_file_lans) 
{
	foreach $source_file (@source_files)
	{
		$absolut_file = $source_file;
		$source_file =~ /$file_path(.*)\.qml/;
		$ts_file = $1."_".$language.$localed_file_suffix;
		system ("lupdate $absolut_file -ts $out_put_folder/$ts_file");
	}
	#for rconstdifinition.h
	#system ("lupdate ereader/rconstdifinition.h -ts $out_put_folder/rconstdifinition_$language$localed_file_suffix");
}



foreach $language (@local_file_lans) 
{
	system ("lrelease $out_put_folder/*_$language.ts -qm $out_put_folder/$localed_file_prefix$language$compiled_file_suffix");
}
